package com.victor.controller.app;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.victor.entity.JQActivity;
import com.victor.entity.Jingqulist;
import com.victor.entity.YYactivityOrder;
import com.victor.service.ActivityAppService;
import com.victor.utils.Msg;

/**
 * app旅游活动
 * 
 * @author zhangbin
 *
 */
@RestController
@RequestMapping("/app")
public class ActivityAppController {

	@Autowired
	private ActivityAppService service;

	/**
	 * 景区演艺活动
	 */
	// 获取景区演艺活动列表
	@RequestMapping("/getYYactivity")
	public Msg getYYactivity(String jqAcOneID, String jqAcTwoID, String priceLifting) {// priceLifting价格升降 0价格升序 1价格降序
		List<JQActivity> jqActivities = service.getYYactivity(jqAcOneID, jqAcTwoID, priceLifting);
		return Msg.success().add("jqActivities", jqActivities);
	}

	// 获取景区演艺活动详情
	@RequestMapping("/getYYactivityXQ")
	public Msg getYYactivityXQ(String jqacid) {

		JQActivity jqActivity = service.getYYactivityXQ(jqacid);
		if (jqActivity != null) {
			return Msg.success().add("jqActivity", jqActivity);
		}
		return Msg.fail();
	}

	// 提交演艺活动订单
	@RequestMapping("/submitYYactivityOrder")
	public Msg submitYYactivityOrder(YYactivityOrder yyactivityOrder) {
		boolean insResult = service.submitYYactivityOrder(yyactivityOrder);
		return Msg.judge(insResult);
	}

	/**
	 * 票务活动
	 */
	// ActivityController中查询方法
	// 查询团购列表 ifgroupbuy==1
	@RequestMapping("/getJQlist")
	public Msg getGroupbuyjqlist(String jqclassid) {
		List<Jingqulist> groupbuyjqlists = service.getGroupbuyjqlist(jqclassid);
		return Msg.success().add("groupbuyjqlists", groupbuyjqlists);
	}

	// 参加团购 TODO
	
}
